<!-- {% if latest_question_list %}
    <ul>
    {% for question in latest_question_list %}
        <li><a href="{% url 'polls:detail' question.id %}">{{ question.question_text }}</a></li>
    {% endfor %}
    </ul>
{% else %}
    <p>No polls are available.</p>
{% endif %} -->


<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>投票应用</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
        }
        
        body {
            background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 40px 20px;
            color: #333;
        }
        
        .container {
            max-width: 800px;
            width: 100%;
            background: white;
            border-radius: 16px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
            overflow: hidden;
            margin-top: 20px;
        }
        
        header {
            background: linear-gradient(to right, #4b6cb7, #182848);
            color: white;
            padding: 30px 40px;
            text-align: center;
        }
        
        h1 {
            font-size: 2.5rem;
            font-weight: 600;
            margin-bottom: 10px;
            letter-spacing: -0.5px;
        }
        
        .subtitle {
            font-size: 1.1rem;
            opacity: 0.9;
            font-weight: 300;
            max-width: 600px;
            margin: 0 auto;
            line-height: 1.6;
        }
        
        .content {
            padding: 40px;
        }
        
        .poll-container {
            margin-top: 20px;
        }
        
        .poll-list {
            list-style: none;
        }
        
        .poll-item {
            background: #fff;
            border-radius: 12px;
            margin-bottom: 15px;
            transition: all 0.3s ease;
            border: 1px solid #eaeaea;
            overflow: hidden;
            box-shadow: 0 3px 10px rgba(0, 0, 0, 0.03);
        }
        
        .poll-item:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
            border-color: #d0e3ff;
        }
        
        .poll-link {
            display: flex;
            align-items: center;
            padding: 20px 25px;
            text-decoration: none;
            color: #2c3e50;
            font-size: 1.1rem;
            font-weight: 500;
        }
        
        .poll-link i {
            margin-right: 15px;
            color: #4b6cb7;
            font-size: 1.3rem;
            transition: transform 0.3s ease;
        }
        
        .poll-link:hover i {
            transform: scale(1.2);
            color: #ff6b6b;
        }
        
        .poll-link span {
            flex: 1;
            transition: color 0.3s ease;
        }
        
        .poll-link:hover span {
            color: #4b6cb7;
        }
        
        .no-polls {
            text-align: center;
            padding: 50px 20px;
            color: #7f8c8d;
            font-size: 1.2rem;
            background: #f9fbfd;
            border-radius: 12px;
            border: 1px dashed #e0e6ed;
        }
        
        .no-polls i {
            font-size: 3rem;
            margin-bottom: 20px;
            color: #bdc3c7;
            display: block;
        }
        
        footer {
            text-align: center;
            padding: 25px;
            color: #7f8c8d;
            font-size: 0.9rem;
            border-top: 1px solid #eee;
            background: #f9fbfd;
        }
        
        .stats {
            display: flex;
            justify-content: center;
            gap: 30px;
            margin-top: 15px;
        }
        
        .stat-item {
            background: #f0f5ff;
            padding: 10px 20px;
            border-radius: 50px;
            font-size: 0.9rem;
            color: #4b6cb7;
            font-weight: 500;
        }
        
        @media (max-width: 600px) {
            .content {
                padding: 25px 20px;
            }
            
            header {
                padding: 25px 20px;
            }
            
            h1 {
                font-size: 2rem;
            }
            
            .poll-link {
                padding: 16px 20px;
                font-size: 1rem;
            }
            
            .stats {
                flex-direction: column;
                gap: 10px;
                align-items: center;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <header>
            <h1><i class="fas fa-poll"></i> 投票应用</h1>
            <p class="subtitle">参与下面的投票，表达您的意见。每个问题都很重要，您的参与将帮助我们更好地了解社区观点。</p>
        </header>
        
        <div class="content">
            <div class="poll-container">
                {% if latest_question_list %}
                    <ul class="poll-list">
                        {% for question in latest_question_list %}
                            <li class="poll-item">
                                <a href="{% url 'polls:detail' question.id %}" class="poll-link">
                                    <i class="fas fa-question-circle"></i>
                                    <span>{{ question.question_text }}</span>
                                    <i class="fas fa-chevron-right"></i>
                                </a>
                            </li>
                        {% endfor %}
                    </ul>
                {% else %}
                    <div class="no-polls">
                        <i class="far fa-folder-open"></i>
                        <p>No polls are available.</p>
                    </div>
                {% endif %}
            </div>
        </div>
        
        <footer>
            <p>投票应用 &copy; 2025 - 让每个人的声音都被听到</p>
            <div class="stats">
                <div class="stat-item"><i class="fas fa-users"></i> <a href="/admin">后台管理</a></div>
                <div class="stat-item"><i class="fas fa-lock"></i> 安全投票</div>
                <div class="stat-item"><i class="fas fa-chart-line"></i> 实时结果</div>
            </div>
        </footer>
    </div>
</body>
</html>